redis frontend

jamesperet 9 years ago
parent
commit
d6228534da
5 changed files with 12 additions and 8 deletions
  1. 2 1
      Gemfile
  2. 4 5
      Gemfile.lock
  3. 2 0
      Procfile
  4. 2 2
      config/initializers/redis.rb
  5. 2 0
      config/routes.rb

+ 2 - 1
Gemfile

@@ -58,7 +58,8 @@ gem 'carrierwave_backgrounder'
58 58
 gem 'i18n'
59 59
 gem 'rails_12factor', group: :production
60 60
 gem 'gibbon'
61
-gem 'resque'
61
+gem 'redis'
62
+gem 'resque', '~> 1.22.0', :require => "resque/server"
62 63
 
63 64
 group :test do
64 65
   gem "rspec"

+ 4 - 5
Gemfile.lock

@@ -157,7 +157,6 @@ GEM
157 157
       subexec (~> 0.2.1)
158 158
     mini_portile (0.6.0)
159 159
     minitest (4.7.5)
160
-    mono_logger (1.1.0)
161 160
     multi_json (1.10.1)
162 161
     multi_test (0.1.1)
163 162
     multi_xml (0.5.5)
@@ -200,10 +199,9 @@ GEM
200 199
     redis-namespace (1.5.1)
201 200
       redis (~> 3.0, >= 3.0.4)
202 201
     ref (1.0.5)
203
-    resque (1.25.2)
204
-      mono_logger (~> 1.0)
202
+    resque (1.22.0)
205 203
       multi_json (~> 1.0)
206
-      redis-namespace (~> 1.3)
204
+      redis-namespace (~> 1.0)
207 205
       sinatra (>= 0.9.2)
208 206
       vegas (~> 0.1.2)
209 207
     rspec (3.1.0)
@@ -316,7 +314,8 @@ DEPENDENCIES
316 314
   rails (= 4.0.4)
317 315
   rails_12factor
318 316
   redcarpet
319
-  resque
317
+  redis
318
+  resque (~> 1.22.0)
320 319
   rspec
321 320
   rspec-rails
322 321
   sass-rails

+ 2 - 0
Procfile

@@ -0,0 +1,2 @@
1
+web: bundle exec rails server -p $PORT
2
+resque: env TERM_CHILD=1 RESQUE_TERM_TIMEOUT=10 bundle exec rake resque:work

+ 2 - 2
config/initializers/redis.rb

@@ -1,3 +1,3 @@
1
-uri = URI.parse(ENV["REDISTOGO_URL"] || "redis://localhost:6379/" )
2
-REDIS = Redis.new(:url => ENV['REDISTOGO_URL'])
1
+uri = URI.parse(ENV["REDISTOGO_URL"])
2
+REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
3 3
 Resque.redis = REDIS

+ 2 - 0
config/routes.rb

@@ -2,6 +2,8 @@ RailsWebsiteTemplate::Application.routes.draw do
2 2
   
3 3
   root 'start#index'
4 4
   
5
+  mount Resque::Server.new, :at => "/resque" 
6
+  
5 7
   get "subscription/create"
6 8
   resources :contact_messages, path: '/contact', :as => :contact_messages
7 9